package com.ruoyi.project.naming.wugeanalysis.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.naming.wugeanalysis.domain.WugeAnalysis;
import com.ruoyi.project.naming.wugeanalysis.mapper.WugeAnalysisMapper;
import com.ruoyi.project.naming.wugeanalysis.service.IWugeAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 五格配置Service业务层处理
 *
 * @author shixiangwen
 * @date 2022-04-22
 */
@Service
@DataSource(DataSourceType.DICT)
public class WugeAnalysisServiceImpl implements IWugeAnalysisService {
    @Autowired
    private WugeAnalysisMapper wugeAnalysisMapper;

    /**
     * 查询五格配置
     *
     * @param id 五格配置ID
     * @return 五格配置
     */
    @Override
    public WugeAnalysis selectWugeAnalysisById(Long id) {
        return wugeAnalysisMapper.selectWugeAnalysisById(id);
    }

    /**
     * 查询五格配置列表
     *
     * @param wugeAnalysis 五格配置
     * @return 五格配置
     */
    @Override
    public List<WugeAnalysis> selectWugeAnalysisList(WugeAnalysis wugeAnalysis) {
        return wugeAnalysisMapper.selectWugeAnalysisList(wugeAnalysis);
    }

    /**
     * 新增五格配置
     *
     * @param wugeAnalysis 五格配置
     * @return 结果
     */
    @Override
    public int insertWugeAnalysis(WugeAnalysis wugeAnalysis) {
        return wugeAnalysisMapper.insertWugeAnalysis(wugeAnalysis);
    }

    /**
     * 修改五格配置
     *
     * @param wugeAnalysis 五格配置
     * @return 结果
     */
    @Override
    public int updateWugeAnalysis(WugeAnalysis wugeAnalysis) {
        return wugeAnalysisMapper.updateWugeAnalysis(wugeAnalysis);
    }

    /**
     * 删除五格配置对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWugeAnalysisByIds(String ids) {
        return wugeAnalysisMapper.deleteWugeAnalysisByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除五格配置信息
     *
     * @param id 五格配置ID
     * @return 结果
     */
    @Override
    public int deleteWugeAnalysisById(Long id) {
        return wugeAnalysisMapper.deleteWugeAnalysisById(id);
    }
}
